/**
 *    Copyright 2009-2015 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.mapping;

import org.apache.ibatis.builder.StaticSqlSource;
import org.apache.ibatis.builder.annotation.ProviderSqlSource;
import org.apache.ibatis.scripting.defaults.RawSqlSource;
import org.apache.ibatis.scripting.xmltags.DynamicSqlSource;

/**
 * 代表了Mapper映射文件或注解中的一个sql语句，真正代表SQL执行语句的是{@link BoundSql}<br>
 * 实现类有以下几类：<br>
 * {@link StaticSqlSource} 负责处理静态语句。<br>
 * {@link ProviderSqlSource}<br>
 * {@link RawSqlSource} 负责处理静态语句,解析只包含有#{}的sql语句,最终会将处理后的SQL语句封装成StaticSqlSource对象。<br>
 * {@link DynamicSqlSource} 负责处理动态SQL语句，解析含有${}的sql语句,最终会将处理后的SQL语句封装成StaticSqlSource对象。<br>
 * {@link VelocitySqlSource} 一个测试类。<br>
 * 	区别：StaticSqlSource 中记录的SQL语句中可能含有“？”占位符， 但是可以直接提交给数据库执行;
 * 		DynamicSqlSource中封装的SQL语句还需要进行一系列解析，才会最终形成数据库可执行的SQL语句。
 * Represents the content of a mapped statement read from an XML file or an annotation. 
 * It creates the SQL that will be passed to the database out of the input parameter received from the user.
 *
 * @author Clinton Begin
 */
public interface SqlSource {
  //通过解析得到BoundSql对象， 其中封装了包含” ？”占位符的SQL语句,以及绑定的实参
  BoundSql getBoundSql(Object parameterObject);

}
